package com.sx.zongzhi.activity;

import android.os.Bundle;
import android.widget.ListView;

import com.sx.zongzhi.BaseActivity;
import com.sx.zongzhi.R;
import com.sx.zongzhi.adapter.DealProcessAdapter;
import com.sx.zongzhi.bean.ProcessBean;
import com.sx.zongzhi.presenter.DisputeProcessPest;
import com.sx.zongzhi.utils.ToastUtils;
import com.sx.zongzhi.view.IDisputeProcessView;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 矛盾纠纷事件办理过程
 */
public class DisputeProcessActivity extends BaseActivity implements IDisputeProcessView{

    @BindView(R.id.listView)
    ListView listView;
    /**事件主键*/
    private String id;
    private DisputeProcessPest processPest;
    @Override
    public void setUI(Bundle savedInstanceState) {
        setContentView(R.layout.activity_dispute_process);
        setTitleName("办理记录");
        ButterKnife.bind(this);
        id=getIntent().getStringExtra("EVENT_ID");
        processPest=new DisputeProcessPest(this);
        processPest.getProcessList(id);
    }

    @Override
    public void showError(String message) {
        ToastUtils.showToast(this,message);
    }

    @Override
    public void getProcessList(List<ProcessBean> processBeanList) {
        if (processBeanList!=null&&processBeanList.size()>0){
            DealProcessAdapter adapter=new DealProcessAdapter(this,R.layout.item_deal_process_list,processBeanList);
            listView.setAdapter(adapter);
        }
    }
}
